﻿@model AutomatedTestDataManagement.Models.HTMLField

@{
    ViewBag.Title = "Delete";
}

<h2>Delete</h2>

<h3>Are you sure you want to delete this?</h3>
<fieldset>
    <legend>HTMLField</legend>

    <div class="display-label">
         @Html.LabelFor(model => model.FieldName, "Field Name")
    </div>
    <div class="display-field">
        @Html.DisplayFor(model => model.FieldName)
    </div>

    <div class="display-label">
         @Html.LabelFor(model => model.FieldType.FieldTypeName, "Field Type")
    </div>
    <div class="display-field">
        @Html.DisplayFor(model => model.FieldType.FieldTypeName)
    </div>
</fieldset>
@using (Html.BeginForm()) {
    <div>
        @Html.ValidationSummary(true)
        @if (ViewData.ModelState.IsValid)
        {
            <input type="submit" value="Delete" /> 
        }
        else
        {
            <table>
                <tr>
                    <th>Page Name</th>
                    <th>Relative Path</th>
                    <th></th>
                </tr>
                @Html.EditorFor(m => m.PagesFields, new { DeleteFromPage = Model.FieldID })
            </table>
        }
    </div>
}
<div>
    @Html.Partial("_NavigationManagementNav")
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
